app.service('checkService',['$http','$q','utilService',function($http,$q,utilService){
    var _this_=this;
    //查询核销订单信息
    _this_.getcheckOrders= function ($scope) {
        var deferred = $q.defer();
        utilService.get({
            url:$scope.app.domain + 'orders/check',
            params:{validationCode:$scope.auth}
        }).then(function(response){
            deferred.resolve(response.data);
        },function(e){
            console.error(e);
            deferred.reject("连接服务器出错！");
        });
        return deferred.promise;
    };

    //添加商品
    _this_.authCheckOrders=function($scope){
        var orderVO={validationCode:$scope.auth,status:5,id:$scope.checkOrders.id};

        var deferred = $q.defer();
        utilService.api({
            url:$scope.app.domain+"orders/update",
            data:orderVO,
            method:'PUT'
        }).then(function(result){
            deferred.resolve(result);
        });
        return deferred.promise;
    }


}]);